package com.cda.mall.dao;

import com.cda.mall.entity.ProductComments;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cda.mall.entity.ProductCommentsVO;
import com.sun.org.glassfish.gmbal.ParameterNames;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 商品评价  Mapper 接口
 * </p>
 *
 * @author cda
 * @since 2021-11-13
 */
@Repository
public interface ProductCommentsMapper extends BaseMapper<ProductComments> {

    /**
     *  根据商品id分页查询评论信息
     * @param productId 商品id
     * @param start 起始索引
     * @param limit 查询条数
     * @return
     */
    public List<ProductCommentsVO> selectCommentsByProductId(@Param("productId") String productId,
                                                             @Param("start") int start,
                                                             @Param("limit") int limit);

    public int selectAll(String productId);


}
